package com.example.encryptedsharedpreferences

enum class DataType(val type: Int) {

    STRING(1), STRING_SET(2), INT(3), LONG(4), FLOAT(5), BOOLEAN(6);

    companion object {

        fun fromType(type: Int): DataType? {
            when (type) {
                1 -> return STRING
                2 -> return STRING_SET
                3 -> return INT
                4 -> return LONG
                5 -> return FLOAT
                6 -> return BOOLEAN
            }
            return null
        }
    }
}